﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EF_CodeFirstForSqlite.Models;

namespace EF_CodeFirstForSqlite.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            List<Student> studentList;
            using (SchoolContext DbContext = new SchoolContext())
            {
                studentList=(from s in DbContext.Students
                            select s).ToList();
            }
            return View(studentList);
        }

    }
}
